﻿<%@ Page MasterPageFile="~/Site.Master" Language="C#" AutoEventWireup="true" CodeBehind="DiscountStrategy.aspx.cs" Inherits="RabbitManage.UI.DiscountStrategy" %>

<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
    
    <form id="form1" action="/Action/DiscountAdd.aspx" method="POST">

        <h3>折扣管理</h3>
    
    <link rel="stylesheet" href="/Share/css/jquery-ui.css">
    <script src="//code.jquery.com/jquery-1.10.2.js"></script>
    <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>   
    <style>
    .me-textarea {
        height: 25px;
        width: 400px;
    }
    </style> 
<%--    <script>
        $(function () {
            $("#inputName").resizable({
                maxWidth: 600,
                minHeight: 25,
                minWidth: 200
            });
            $("#inputPricePerUnit").resizable({
                maxWidth: 600,
                minHeight: 25,
                minWidth: 200
            });
            $("#inputNetWeight").resizable({
                maxWidth: 600,
                minHeight: 25,
                minWidth: 200
            });
            $("#inputGrossWeight").resizable({
                maxWidth: 600,
                minHeight: 25,
                minWidth: 200
            });
            $("#inputQuantity").resizable({
                maxWidth: 600,
                minHeight: 25,
                minWidth: 200
            });
            $("#inputMainImage").resizable({
                maxWidth: 600,
                minHeight: 25,
                minWidth: 200
            });
            $("#inputTitle").resizable({
                maxWidth: 600,
                minHeight: 25,
                minWidth: 200
            });
            $("#inputSubTitle").resizable({
                maxWidth: 600,
                minHeight: 25,
                minWidth: 200
            });
            $("#inputDescription").resizable({
                maxWidth: 600,
                minHeight: 25,
                minWidth: 200
            });
        });
    </script>--%>

    <script type="text/javascript">
        form1.onsubmit = function (e) {
            e.preventDefault();

            var data = {};
            for (var i = 0, ii = form1.length; i < ii; ++i) {
                var input = form1[i];
                if (input.name) {
                    data[input.name] = input.value;
                }
            }

            var xhr = new XMLHttpRequest();
            xhr.open(form1.method, form1.action, true);
            xhr.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');

            xhr.send(JSON.stringify(data));

            xhr.onloadend = function () {
                if (xhr.responseText == "true") {
                    window.location = "/UI/DiscountStrategy.aspx";
                } else {
                    alert(xhr.responseText);
                }
            };
        };
    </script>
        
        
    <table>
        <tr>
            <td>折扣名称</td>
            <td>减免</td>
        </tr>
            
            
        <asp:Repeater runat="server" ID="myRepeater" >
            <ItemTemplate>
                <tr>
                    <td><%#Eval("Reason") %></td>
                    <td><%#Eval("Rebate") %></td>
                    <td>
                        <a href="../Action/DiscountDelete.aspx?id=<%#Container.ItemIndex %>" style="visibility: <%#(int)Container.ItemIndex==0?"hidden":"visible"%>" onclick="return confirm('确认删除？')">删除</a>
                    </td>
                </tr>
            </ItemTemplate>
        </asp:Repeater>
    </table>

    <table>
        <tr>
            <td>原因:</td>
            <td>
                <textarea id="inputReason" name="Reason" class="me-textarea"  ></textarea>
            </td>
        </tr>
        
        <tr>
            <td>减免(元):</td>
            <td>
                <textarea id="inputRebate" name="Rebate" class="me-textarea" ></textarea>
            </td>
        </tr>
        
        <%--<tr>
            <td>净重(kg):</td>
            <td>
                <textarea id="inputNetWeight" name="NetWeight" class="me-textarea" ></textarea>
            </td>
        </tr>
        
        <tr>
            <td>毛重(kg):</td>
            <td>
                <textarea id="inputGrossWeight" name="GrossWeight" class="me-textarea" ></textarea>
            </td>
        </tr>
        
        <tr>
            <td>生产日期:</td>
            <td>
                <input readonly="readonly" type="text" class="Wdate" id="inputProductionDate" name="ProductionDate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
            </td>
        </tr>
        
        <tr>
            <td>库存:</td>
            <td>
                <textarea id="inputQuantity" name="Quantity" class="me-textarea" ></textarea>
            </td>
        </tr>
        
        <tr>
            <td>页面主图:</td>
            <td>
                <textarea id="inputMainImage" name="MainImage" class="me-textarea" ></textarea>
            </td>
        </tr>
        
        <tr>
            <td>页面主标题:</td>
            <td>
                <textarea id="inputTitle" name="Title" class="me-textarea" ></textarea>
            </td>
        </tr>
        
        <tr>
            <td>页面二级标题:</td>
            <td>
                <textarea id="inputSubTitle" name="SubTitle" class="me-textarea" ></textarea>
            </td>
        </tr>
        
        <tr>
            <td>描述:</td>
            <td>
               
            </td>
        </tr>--%>
    </table>
        
        <%--<textarea id="inputDescription" name="description" class="me-textarea" style="height: 200px;"></textarea>
        <br/>--%>
    
        <input type="submit" value="提交" />

    </form>


</asp:Content>